/**
* ...
* @author Default
* @version 0.1
*/

package kizzo.utils 
{
	import flash.events.Event;
	import flash.events.EventDispatcher;
	import kizzo.utils.*;
	
	public class Command 
	{
		public var command:Function;
		public var params:Array;
		public var type:int;
		public var scope:*;
		public var broadcaster:*;
		public var event:Event;
		
		public static const SYNC:int = 1;
		public static const ASYNC:int = 2;
		
		function Command(command:Function, params:Array, type:int, scope:Object, broadcaster:EventDispatcher=null, event:Event=null)
		{
			this.command = command;
			this.params = params;
			this.type = type;
			this.scope = scope;
			this.broadcaster = broadcaster;
			this.event = event;			
		}
		
		public function execute():*
		{
			return this.command.apply(scope, params);
		}
	}
	
}